﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ViewComments.aspx.cs" Inherits="ViewComments" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
    DataKeyNames="CommentID" DataSourceID="SqlDataSource1" 
    onrowcommand="GridView1_RowCommand">
    <Columns>
        <asp:BoundField DataField="CommentID" HeaderText="CommentID" 
            InsertVisible="False" ReadOnly="True" SortExpression="CommentID" />
        <asp:BoundField DataField="Comment" HeaderText="Comment" 
            SortExpression="Comment" />
        <asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
        <asp:ButtonField ButtonType="Button" CommandName="FlagComment" 
            Text="Flag Comment" />
        <asp:ButtonField ButtonType="Button" CommandName="deleteComment" 
            Text="Delete Comment" />
    </Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>" 
    SelectCommand="SELECT [Comment], [Date], [CommentID] FROM [Comment] WHERE ([MovieID] = @MovieID)">
    <SelectParameters>
        <asp:QueryStringParameter Name="MovieID" QueryStringField="MovieID" 
            Type="Int32" />
    </SelectParameters>
</asp:SqlDataSource>
</asp:Content>

